home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / tests / residu.tst < prev    next >
Text File  |  1999-09-16  |  550b  |  18 lines

  1. Leps=1.e-7;
  2. s=poly(0,'s');
  3. p=(s-1)*(s+1)*(s+2)*(s+10);
  4. a=(s-5)*(s-1)*(s*s)*((s+1/2)**2);
  5. b=(s-3)*(s+2/5)*(s+3);
  6. if residu(p,a,b)+(531863/4410) > Leps then pause,end
  7. z=poly(0,'z');
  8. a=z^3+0.7*z^2+0.5*z-0.3;
  9. b=z^3+0.3*z^2+0.2*z+0.1;
  10. deff('[ptild]=tilde(p,s)','c=coeff(p),n=degree(p)+1,c=c(n:-1:1),...
  11. s=poly(0,s),ptild=0,...
  12. for k=1:n,ptild=ptild+c(k)*s^(k-1),end')
  13. atild=tilde(a,'z');
  14. btild=tilde(b,'z');
  15. if residu(b*btild,z*a,atild)-2.9488038 > Leps then pause,end
  16. a=a+0*%i;b=b+0*%i;
  17. if real(residu(b*btild,z*a,atild)-2.9488038) > Leps then pause,end
  18.